import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home/list',  // 重定向:重新指向其它path,会改变网址: 'home',
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/index.vue'),
      children: [
        {
          path: 'list',
          name: 'list',
          component: () => import('@/views/home/children/list.vue'),
        },
        {
          path: 'index',
          name: 'index',
          component: () => import('@/views/home/children/index.vue'),
        },
        {
          path: 'shop',
          name: 'shop',
          component: () => import('@/views/home/children/shop.vue'),
        },
        {
          path: 'my',
          name: 'my',
          component: () => import('@/views/home/children/my.vue'),
        },
      ]
    },
  ],
})

export default router
